package com.xmg.boot.demo.bootlesson1.user.handler.Exception;

import lombok.Data;

/**
 * @author: ma
 * @date: 2023-12-04
 * @since: 自定义异常类
 */
@Data
public class BaseException extends RuntimeException {
    // 错误码
    private String code;

    //错误信息
    private String message;

    public BaseException(){
        super();
    }

    //自定义异常构造方法
    public BaseException(BaseExceptionEnum baseExceptionEnum){
        super(baseExceptionEnum.getCode());
        this.code=baseExceptionEnum.getCode();
        this.message=baseExceptionEnum.getMessage();
    }

}
